package com.java1412.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1412
 * @since 2023-06-06 14:43:22
 */
@RestController
public class HiController {
    @Value("${server.port}")
    private String port;

    @RequestMapping("/hi")
    public String hi(@RequestParam(name = "name", required = false, defaultValue = "java1412") String name) {
        return "hi " + name + " ,i am from port:" + port;
    }
}
